package com.springboot.cloud.web.exception;

/**
 * <p> 全局自定义异常信息 </p>
 *
 * @author Bertram
 * @since 11/7/2019 2:31 PM
 */
public class BusinessException extends RuntimeException{
    private static final long serialVersionUID = 1L;

    private Integer status = 400;

    private String message;

    public BusinessException(Integer code, String message) {
        super(message);
        this.status = code;
        this.message = message;
    }

    public BusinessException(String message) {
        super(message);
        this.message = message;
    }

    public BusinessException(String message, Throwable e) {
        super(message, e);
        this.message = message;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }


    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
